﻿@model PagedList<Common.Background.WebManageUsers>
@using EntityFrameworks.Entity.Core.CommonEnums
@using EntityFrameworks.Entity.Core
@using EntityFrameworks.Web.Core.Helper
@{
   
    ViewBag.Title = "Index";
    
     
}
@Html.Partial("ContentListTag.Partial", new List<Common.Background.Models.LinkModel> { new Common.Background.Models.LinkModel("用户列表") })
<p>
    用户：<input type="text" name="UserName" id="UserName" />&nbsp;&nbsp;部门：<input type="text"
        name="DeptName" id="DeptName" />
</p>
<p>
    时间：<input type="text" name="StartTime" id="StartTime" />&nbsp;&nbsp;&nbsp;&nbsp;到&nbsp;&nbsp;&nbsp;&nbsp;<input
        type="text" name="EndTime" id="EndTime" />&nbsp;&nbsp;
    <input type="button" id="search" value="查询" />
    @Html.ActionLink("建立一个用户", "Create", null, new { @class = "button" })
</p>
<div id="list">
    @Html.Partial("List", Model)
</div>
<script type="text/javascript">
    $(function () {
        $("#UserName").val('@Request.QueryString["username"]')
        $("#DeptName").val('@Request.QueryString["deptname"]')
        $("#StartTime").bind("click focus", function () { WdatePicker({ isShowClear: false, readOnly: false }); });
        $("#EndTime").bind("click focus", function () { WdatePicker({ isShowClear: false, readOnly: false }); });
        $("#search").click(function () {
            $.ajax({
                type: "GET",
                url: "/WebUser/Index",
                data: {
                    username: document.getElementById("UserName").value
                    , deptname: document.getElementById("DeptName").value
                    , startTime: document.getElementById("StartTime").value
                    , endTime: document.getElementById("EndTime").value
                    , page: 1
                },
                success: function (data) {
                    $("#list").html(data);
                }
            });
        });
    });
</script>
